//
//  SEGNewSelectCommunityViewModel.h
//  SEGViewModel
//
//  Created by 乔杨 on 2020/6/15.
//

#import <Foundation/Foundation.h>
#import "SEGRequestManager.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, SEGTableViewShowType) {// 列表类型
    SEGTableViewShowType_SelectList = 0, /*默认选择小区列表*/
    SEGTableViewShowType_SearchList = 1, /*搜索列表*/
};
typedef NS_ENUM(NSUInteger, SEGSelectCommunitySectionType) {// 列表Section类型
    SEGSelectCommunitySectionType_CurrentCommunity = 0, /*当前小区*/
    SEGSelectCommunitySectionType_SearchHistory = 1, /*历史记录*/
    SEGSelectCommunitySectionType_HotCommunity = 2 /*热门社区*/
};

@interface SEGNewSelectCommunityViewModel : NSObject

/// 获取我的搜索历史信号
@property (nonatomic, strong) RACSignal *searchHistorySignal;
/// 判断传入的小区id来请求 选择小区接口
@property (nonatomic, strong) RACCommand *registerCommand;
/// 获取同城热门社区信号
@property (nonatomic, strong) RACSignal *hotCommunitySignal;
/// 获取城市列表信号
@property (nonatomic, strong) RACSignal *cityListSignal;
/// 切换小区信号
@property (nonatomic, strong) RACSignal *changeCommunitySignal;
/// 搜索小区信号（需要传入输入的搜索字段）
@property (nonatomic, strong) RACCommand *searchCommunityCommand;
/// 添加到历史记录信号
@property (nonatomic, strong) RACSignal *saveHistorySignal;
/// 删除社区信号
@property (nonatomic, strong) RACCommand *deleteCommunityCommand;
/// 未搜索到内容，跳转默认小区的信号
@property (nonatomic, strong) RACCommand *noSearchResultCommand;

/// 网络请求
@property (nonatomic, strong) SEGRequestManager *requestManager;
/// 历史记录数据源
@property (nonatomic, copy) NSArray <SEGChangeCommunityModel *> *historyArray;
/// 热门社区数据源
@property (nonatomic, copy) NSArray <SEGChangeCommunityModel *> *hotCommunityArray;
/// 搜索小区列表数据源
@property (nonatomic, copy) NSArray <SEGSearchCommunityModel *> *searchCommunityArray;
/// 热门小区标签数组
@property (nonatomic, copy) NSArray *tagsArray;
/// 城市编码
@property (nonatomic, copy) NSString *cityCode;
/// 城市名称
@property (nonatomic, copy) NSString *cityName;
/// 当前定位城市名称
@property (nonatomic, copy) NSString *locatedCityName;
/// 选择的小区ID
@property (nonatomic, copy) NSString *communityId;
/// 选择的小区名称
@property (nonatomic, copy) NSString *communityName;
/// 是否显示全部历史记录列表
@property (nonatomic, assign) BOOL isShowAllHistoryList;
/// 列表显示样式
@property (nonatomic, assign) SEGTableViewShowType showType;

@end

NS_ASSUME_NONNULL_END
